// custom-tab-bar/index.js
Component({
	/**
	 * 组件的属性列表
	 */
	properties: {

	},

	/**
	 * 组件的初始数据
	 */
	data: {
		selected:null,//当前选中
		list:[
			{
				"pagePath":"/pages/index/index",
				'iconPath':"/static/images/work.png",
				"selectedIconPath":"/static/images/work_active.png",
				"text":'工作'
			},
			{
				"pagePath": "/pages/assistant/assistant",
				"selectedIconPath":"/static/images/work_active.png",
				"text": "助手",
				"iconPath": "/static/images/helper.png"
			},
		  {
        "pagePath": "/pages/common/common",
        "text": "常用"
			},
			{
				"pagePath": "/pages/analyse/analyse",
				"selectedIconPath":"/static/images/work_active.png",
				"text": "分析",
				"iconPath": "/static/images/analyse_bar.png"
			},
			{
				"pagePath": "/pages/my/my",
				"selectedIconPath":"/static/images/work_active.png",
				"text": "我",
				"iconPath": "/static/images/my.png"
			},
		]

	},

	/**
	 * 组件的方法列表
	 */
	methods: {
    switchTab(e){
			const {index,url} = e.currentTarget.dataset
			if(this.data.selected == index || index==undefined) return;
			wx.switchTab({
				url,
			})
		}
	}
})
